<!-- HTML header for doxygen 1.8.13-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.2"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Hardware Abstraction Layer (HAL)</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen_style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><a href="http://www.cypress.com/"><img alt="Logo" src="logo.png"/></a></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Hardware Abstraction Layer (HAL)</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.2 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search",'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(document).ready(function(){initNavTree('group__group__hal__syspm.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#groups">API Reference</a> &#124;
<a href="#nested-classes">Data Structures</a> &#124;
<a href="#define-members">Macros</a> &#124;
<a href="#typedef-members">Typedefs</a> &#124;
<a href="#enum-members">Enumerations</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle"><div class="title">System Power Management<div class="ingroups"><a class="el" href="group__group__hal__types.html">HAL General Types/Macros</a> &raquo; <a class="el" href="group__group__hal__general__types.html">General Types</a> &#124; <a class="el" href="group__group__hal.html">HAL Drivers</a></div></div></div>
</div><!--header-->
<div class="contents">
<a name="details" id="details"></a><h2 class="groupheader">General Description</h2>
<p >Interface for changing power states and restricting when they are allowed. </p>
<p >Power management is handled both at a system level and at a peripheral driver level. The system wide API (this) allows the user to interact with the product as a whole. Additionally, each peripheral keeps track of what its state is and whether it can safely move to a new state while still maintaining any current operations. To initialize the system wide power management, <a class="el" href="group__group__hal__syspm.html#ga299e36096b0ad36b29afe3c5bb02a6d7">cyhal_syspm_init</a> should be called as part of the initial device startup.</p>
<p >At the System level, the APIs are intended to allow the application to specify exactly what is happening. It can request changes to both the MCU Power State as well as the System Wide Power State. There are three supported MCU Power States:</p><ul>
<li>Active - This is the normal operating state of the MCU</li>
<li>Sleep - In this state the MCU is no longer running. It can be woken up again from an interrupt. This state is reached by calling <a class="el" href="group__group__hal__syspm.html#gac3e07ce98d215865b0f7f0149073bae2">cyhal_syspm_sleep</a>.</li>
<li>Deep Sleep - In this state the MCU is no longer running. It can only be woken up by select interrupts. This state is reached by calling <a class="el" href="group__group__hal__syspm.html#ga0afe7e58c0df4a2eda5010ac628ea981">cyhal_syspm_deepsleep</a>. </li>
</ul>
<p >Additionally, there are three supported system states:</p><ul>
<li>Normal (<a class="el" href="group__group__hal__syspm.html#gga144e474d3bfb544b207f172d1d8bd633acd2a5522b6591eb77418369e464a3eb1">CYHAL_SYSPM_SYSTEM_NORMAL</a>) - This is a normal operating state for the device. This is exposed by <a class="el" href="group__group__hal__syspm.html#gaae0157682bad1b2155738e73347afa87">cyhal_syspm_set_system_state</a>.</li>
<li>Low (<a class="el" href="group__group__hal__syspm.html#gga144e474d3bfb544b207f172d1d8bd633af4060b98561e43a6b930576644af014f">CYHAL_SYSPM_SYSTEM_LOW</a>) - This is a lower power operating state that may be supported by the device. This state often imposes specific requirements on clock speeds and voltage levels. See the device specific documentation for any device specific requirements for this mode, or whether it is even supported. If the device supports this mode, it is exposed by <a class="el" href="group__group__hal__syspm.html#gaae0157682bad1b2155738e73347afa87">cyhal_syspm_set_system_state</a>.</li>
<li>Hibernate - This is the lowest available power state. In this state most of the chip is powered down. It has a very limited number of wakeup sources, and may require the device to reboot in order to come back up. It can be accessed by calling <a class="el" href="group__group__hal__syspm.html#ga507445e44ab6aae0f4cbaabaec6c5a3f">cyhal_syspm_hibernate</a>.</li>
</ul>
<p >Any time a power state transition is requested a series of callbacks are invoked. This allows peripherals, or other parts of the application, to confirm they are not currently doing something that would not work in the requested power state. HAL Peripheral drivers automatically register these callbacks when they are initialized. The application also has the option to register a callback function(s) to be called on requested state transitions by callling <a class="el" href="group__group__hal__syspm.html#ga5d1637ece9b27528636981acfc893fd3">cyhal_syspm_register_callback</a>. If registered, the application level callbacks are invoked first. This gives the application a chance stop any peripherals, if appropriate, to ensure the power transition can actually happen. Alternatively it can directly reject the transition. Each callback registered can specify the exact set of states ( <a class="el" href="group__group__hal__syspm.html#ga560aa7873d3131c4eb5d1453711305d2">cyhal_syspm_callback_state_t</a> ) that it should be called for. Each callback is invoked multiple times as part of the transition process as defined by <a class="el" href="group__group__hal__syspm.html#ga5a6a88eb2b6e35dbea25e36b027bf4ba">cyhal_syspm_callback_mode_t</a>.</p>
<p >At any point the code can lock the ability to enter deep sleep by calling <a class="el" href="group__group__hal__syspm.html#ga3568214a6038240239f99768fe6707d6">cyhal_syspm_lock_deepsleep</a>. This should be done in critical blocks that need to continue remain active. When the critical work is complete, and the lock is no longer needed, it can be released by calling <a class="el" href="group__group__hal__syspm.html#ga028b85f03d4607ccac8494b46ec8413c">cyhal_syspm_unlock_deepsleep</a>. The lock is a counter with a max count of USHRT_MAX. It must be locked/unlocked an equal number of times before the device is actually able to enter deep sleep.</p>
<p >All peripherals are expected to operate in the default Active/Normal power state. Some peripherals (primarily analog) can operate in lower power states as well. These drivers will operate in all power states that the hardware supports.</p>
<p >When power transitions are requested each type of peripheral has a default behavior. Peripherals that can continue to operate in the requested power mode do not interfere. Peripherals that are not currently active allow the transition, but make sure they restore their state if needed for when the device comes back. Peripherals that are active and cannot continue to work in the requested power state will block the transition.</p>
<dl class="section note"><dt>Note</dt><dd>The power management functionality available depends on the availability of the features in the hardware. For detailed information about exactly what is supported on each device, refer to the Device Datasheet or Technical Reference Manual (TRM).</dd></dl>
<h1><a class="anchor" id="section_syspm_features"></a>
Features</h1>
<p >This driver provides control over multiple different types of power management and when those transitions are allowed:</p><ul>
<li>Change CPU Power State: APIs to allow changing the current CPU state into one of the lower power CPU states (SLEEP, DEEPSLEEP)</li>
<li>Change System Power State: An API allows for changing the system wide power state between one of states (NORMAL, LOW)</li>
<li>Hibernate: An API that allows to set the hibernate wakeup source and set the system state to Hibernate.</li>
<li>General Purpose Power State Transition Callback: APIs allow for registering/unregistering a callback function to be notified when various power state transitions happen. If registered, the application can do anything necessary at power transitions. It can even prevent the transition if need-be.</li>
<li>Peripheral Specific Power State Transition Callback: APIs allow for registering/unregistering a callback function to be called when a peripheral with a CUSTOM power mode strategy exists and a power mode transition is requested. This allows the application to customize when it is OK for the peripheral to enter a low power state.</li>
<li>Lock DeepSleep: APIs to prevent/allow the CPU from going to deep sleep. This is a convenience API rather than needing to implement a full Transition Callback handler.</li>
</ul>
<h1><a class="anchor" id="section_syspm_quickstart"></a>
Quick Start</h1>
<p >Unlike most HAL drivers this does not require initializing an instance object. The APIs provided here can be called at anytime. See the snippets below for examples of how to use this driver.</p>
<h1><a class="anchor" id="section_syspm_snippets"></a>
Code Snippets</h1>
<h2><a class="anchor" id="subsection_syspm_snippet_1"></a>
Snippet 1: Simple deep sleep locking</h2>
<p >The following snippet shows how to use the deep sleep locking APIs to restrict when the device can enter deep sleep. In between the lock/unlock calls any attempt to change power modes will automatically be canceled. </p><div class="fragment"><div class="line">    <a class="code hl_function" href="group__group__hal__syspm.html#ga3568214a6038240239f99768fe6707d6">cyhal_syspm_lock_deepsleep</a>();</div>
<div class="line"> </div>
<div class="line">    <span class="comment">// Perform work that should not be interrupted by deepsleep</span></div>
<div class="line"> </div>
<div class="line">    <a class="code hl_function" href="group__group__hal__syspm.html#ga028b85f03d4607ccac8494b46ec8413c">cyhal_syspm_unlock_deepsleep</a>();</div>
<div class="ttc" id="agroup__group__hal__syspm_html_ga028b85f03d4607ccac8494b46ec8413c"><div class="ttname"><a href="group__group__hal__syspm.html#ga028b85f03d4607ccac8494b46ec8413c">cyhal_syspm_unlock_deepsleep</a></div><div class="ttdeci">void cyhal_syspm_unlock_deepsleep(void)</div><div class="ttdoc">Unlock deep sleep.</div></div>
<div class="ttc" id="agroup__group__hal__syspm_html_ga3568214a6038240239f99768fe6707d6"><div class="ttname"><a href="group__group__hal__syspm.html#ga3568214a6038240239f99768fe6707d6">cyhal_syspm_lock_deepsleep</a></div><div class="ttdeci">void cyhal_syspm_lock_deepsleep(void)</div><div class="ttdoc">Lock deep sleep.</div></div>
</div><!-- fragment --><h2><a class="anchor" id="subsection_syspm_snippet_2"></a>
Snippet 2: Calling different power state functions</h2>
<p >The following snippet shows the different functions that exist to change power states on the device and how they can each be called. </p><div class="fragment"><div class="line">    <a class="code hl_typedef" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a> rslt;</div>
<div class="line"> </div>
<div class="line">    <span class="comment">// Put the MCU to sleep. Peripherals will continue to operate.</span></div>
<div class="line">    rslt = <a class="code hl_function" href="group__group__hal__syspm.html#gac3e07ce98d215865b0f7f0149073bae2">cyhal_syspm_sleep</a>();</div>
<div class="line"> </div>
<div class="line">    <span class="comment">// Put the MCU to deep-sleep. Many peripherals will also stop.</span></div>
<div class="line">    rslt = <a class="code hl_function" href="group__group__hal__syspm.html#ga0afe7e58c0df4a2eda5010ac628ea981">cyhal_syspm_deepsleep</a>();</div>
<div class="line"> </div>
<div class="line">    <span class="comment">// Put the system into a hibernate state. Most of the system will stop.</span></div>
<div class="line">    rslt = <a class="code hl_function" href="group__group__hal__syspm.html#ga507445e44ab6aae0f4cbaabaec6c5a3f">cyhal_syspm_hibernate</a>(<a class="code hl_enumvalue" href="group__group__hal__syspm.html#gga716955af458772e538910575cbf6e1dda519c726a562e214bd1694137e62a22e1">CYHAL_SYSPM_HIBERNATE_WDT</a>);</div>
<div class="line"> </div>
<div class="line">    <span class="comment">// Put the system into a low power state. Peripherals will continue to work, but some may have</span></div>
<div class="line">    <span class="comment">// restrictions on operating clock frequency or voltages.</span></div>
<div class="line">    rslt = <a class="code hl_function" href="group__group__hal__syspm.html#gaae0157682bad1b2155738e73347afa87">cyhal_syspm_set_system_state</a>(<a class="code hl_enumvalue" href="group__group__hal__syspm.html#gga144e474d3bfb544b207f172d1d8bd633af4060b98561e43a6b930576644af014f">CYHAL_SYSPM_SYSTEM_LOW</a>);</div>
<div class="line"> </div>
<div class="ttc" id="agroup__group__hal__syspm_html_ga0afe7e58c0df4a2eda5010ac628ea981"><div class="ttname"><a href="group__group__hal__syspm.html#ga0afe7e58c0df4a2eda5010ac628ea981">cyhal_syspm_deepsleep</a></div><div class="ttdeci">cy_rslt_t cyhal_syspm_deepsleep(void)</div><div class="ttdoc">Set CPU to deep sleep mode.</div></div>
<div class="ttc" id="agroup__group__hal__syspm_html_ga507445e44ab6aae0f4cbaabaec6c5a3f"><div class="ttname"><a href="group__group__hal__syspm.html#ga507445e44ab6aae0f4cbaabaec6c5a3f">cyhal_syspm_hibernate</a></div><div class="ttdeci">cy_rslt_t cyhal_syspm_hibernate(cyhal_syspm_hibernate_source_t wakeup_source)</div><div class="ttdoc">Sets the system mode to hibernate.</div></div>
<div class="ttc" id="agroup__group__hal__syspm_html_gaae0157682bad1b2155738e73347afa87"><div class="ttname"><a href="group__group__hal__syspm.html#gaae0157682bad1b2155738e73347afa87">cyhal_syspm_set_system_state</a></div><div class="ttdeci">cy_rslt_t cyhal_syspm_set_system_state(cyhal_syspm_system_state_t state)</div><div class="ttdoc">Set the system-wide state of the device.</div></div>
<div class="ttc" id="agroup__group__hal__syspm_html_gac3e07ce98d215865b0f7f0149073bae2"><div class="ttname"><a href="group__group__hal__syspm.html#gac3e07ce98d215865b0f7f0149073bae2">cyhal_syspm_sleep</a></div><div class="ttdeci">cy_rslt_t cyhal_syspm_sleep(void)</div><div class="ttdoc">Set CPU to sleep mode.</div></div>
<div class="ttc" id="agroup__group__hal__syspm_html_gga144e474d3bfb544b207f172d1d8bd633af4060b98561e43a6b930576644af014f"><div class="ttname"><a href="group__group__hal__syspm.html#gga144e474d3bfb544b207f172d1d8bd633af4060b98561e43a6b930576644af014f">CYHAL_SYSPM_SYSTEM_LOW</a></div><div class="ttdeci">@ CYHAL_SYSPM_SYSTEM_LOW</div><div class="ttdoc">Low Power Mode.</div><div class="ttdef"><b>Definition:</b> cyhal_syspm.h:206</div></div>
<div class="ttc" id="agroup__group__hal__syspm_html_gga716955af458772e538910575cbf6e1dda519c726a562e214bd1694137e62a22e1"><div class="ttname"><a href="group__group__hal__syspm.html#gga716955af458772e538910575cbf6e1dda519c726a562e214bd1694137e62a22e1">CYHAL_SYSPM_HIBERNATE_WDT</a></div><div class="ttdeci">@ CYHAL_SYSPM_HIBERNATE_WDT</div><div class="ttdoc">Configure the WDT interrupt as wakeup source.</div><div class="ttdef"><b>Definition:</b> cyhal_syspm.h:232</div></div>
<div class="ttc" id="agroup__group__result_html_gaca79700fcc701534ce61778a9bcf57d1"><div class="ttname"><a href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a></div><div class="ttdeci">uint32_t cy_rslt_t</div><div class="ttdoc">Provides the result of an operation as a structured bitfield.</div><div class="ttdef"><b>Definition:</b> cy_result.h:438</div></div>
</div><!-- fragment --><h2><a class="anchor" id="subsection_syspm_snippet_3"></a>
Snippet 3: Using callbacks for application power management</h2>
<p >The following snippet shows how to use the callback mechanisms to manage whether it is safe to enter low power modes. </p><div class="fragment"><div class="line"><span class="keywordtype">bool</span> syspm_app_callback(<a class="code hl_enumeration" href="group__group__hal__syspm.html#ga560aa7873d3131c4eb5d1453711305d2">cyhal_syspm_callback_state_t</a> state, <a class="code hl_enumeration" href="group__group__hal__syspm.html#ga5a6a88eb2b6e35dbea25e36b027bf4ba">cyhal_syspm_callback_mode_t</a> mode,</div>
<div class="line">                        <span class="keywordtype">void</span>* callback_arg)</div>
<div class="line">{</div>
<div class="line">    (void)callback_arg;</div>
<div class="line">    <span class="keywordtype">bool</span> allow_transition = <span class="keyword">true</span>;</div>
<div class="line"> </div>
<div class="line">    <span class="keywordflow">switch</span> (mode)</div>
<div class="line">    {</div>
<div class="line">        <span class="keywordflow">case</span> <a class="code hl_enumvalue" href="group__group__hal__syspm.html#gga5a6a88eb2b6e35dbea25e36b027bf4baa1d8aad9b05d313a22e7666a98414f26d">CYHAL_SYSPM_CHECK_READY</a>:</div>
<div class="line">            <span class="comment">// Check to see if it is OK to change power modes.</span></div>
<div class="line">            <span class="comment">// If it is OK the change, make sure nothing will invalidate this and return true.</span></div>
<div class="line">            <span class="comment">// If it is not OK the change, return false.</span></div>
<div class="line"> </div>
<div class="line">            <span class="comment">// Example: prevent transition if requested mode is HIBERNATE.</span></div>
<div class="line">            allow_transition = (state != <a class="code hl_enumvalue" href="group__group__hal__syspm.html#gga560aa7873d3131c4eb5d1453711305d2ac9de4348b02a53d947ce48bd7bc6922a">CYHAL_SYSPM_CB_SYSTEM_HIBERNATE</a>);</div>
<div class="line">            <span class="keywordflow">break</span>;</div>
<div class="line"> </div>
<div class="line">        <span class="keywordflow">case</span> <a class="code hl_enumvalue" href="group__group__hal__syspm.html#gga5a6a88eb2b6e35dbea25e36b027bf4baa190eae9b4e71d4c245038320880dcca3">CYHAL_SYSPM_CHECK_FAIL</a>:</div>
<div class="line">            <span class="comment">// Undo anything done as part of CHECK_READY since it is not actually chaning.</span></div>
<div class="line">            <span class="keywordflow">break</span>;</div>
<div class="line"> </div>
<div class="line">        <span class="keywordflow">case</span> <a class="code hl_enumvalue" href="group__group__hal__syspm.html#gga5a6a88eb2b6e35dbea25e36b027bf4baadd83c77cb81d9d4aafef1d094e6c4e71">CYHAL_SYSPM_BEFORE_TRANSITION</a>:</div>
<div class="line">            <span class="comment">// Do anything necessary to shut things down.</span></div>
<div class="line">            <span class="keywordflow">break</span>;</div>
<div class="line"> </div>
<div class="line">        <span class="keywordflow">case</span> <a class="code hl_enumvalue" href="group__group__hal__syspm.html#gga5a6a88eb2b6e35dbea25e36b027bf4baaf6a195dbd042da0bffc35b9161ca49e6">CYHAL_SYSPM_AFTER_TRANSITION</a>:</div>
<div class="line">            <span class="comment">// Undo anything done as part of CHECK_READY or BEFORE_TRANSITION since it is coming</span></div>
<div class="line">            <span class="comment">// back up.</span></div>
<div class="line">            <span class="keywordflow">break</span>;</div>
<div class="line"> </div>
<div class="line">        <span class="keywordflow">case</span> <a class="code hl_enumvalue" href="group__group__hal__syspm.html#gga5a6a88eb2b6e35dbea25e36b027bf4baa229203f249d95cf1cac7414c1baf66f3">CYHAL_SYSPM_AFTER_DS_WFI_TRANSITION</a>:</div>
<div class="line">            <span class="comment">// Do anything necessary after deepsleep wakeup and before interrupts getting enabled.</span></div>
<div class="line">            <span class="keywordflow">break</span>;</div>
<div class="line">    }</div>
<div class="line"> </div>
<div class="line">    <span class="keywordflow">return</span> allow_transition;</div>
<div class="line">}</div>
<div class="line"> </div>
<div class="line"> </div>
<div class="line"><span class="keywordtype">void</span> snippet_cyhal_syspm_app_callback(<span class="keywordtype">void</span>)</div>
<div class="line">{</div>
<div class="line">    <a class="code hl_typedef" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a>                   rslt;</div>
<div class="line">    <a class="code hl_struct" href="group__group__hal__syspm.html#structcyhal__syspm__callback__data__t">cyhal_syspm_callback_data_t</a> callback_data =</div>
<div class="line">    {</div>
<div class="line">        .<a class="code hl_variable" href="group__group__hal__syspm.html#aacd72d2e829b54c27e98e6495ca4dfd8">callback</a> = syspm_app_callback,</div>
<div class="line">        .states   =</div>
<div class="line">            (<a class="code hl_enumeration" href="group__group__hal__syspm.html#ga560aa7873d3131c4eb5d1453711305d2">cyhal_syspm_callback_state_t</a>)(<a class="code hl_enumvalue" href="group__group__hal__syspm.html#gga560aa7873d3131c4eb5d1453711305d2ac9de4348b02a53d947ce48bd7bc6922a">CYHAL_SYSPM_CB_SYSTEM_HIBERNATE</a> |</div>
<div class="line">                                           <a class="code hl_enumvalue" href="group__group__hal__syspm.html#gga560aa7873d3131c4eb5d1453711305d2af13d1c94115a90b1f9d734ace0017045">CYHAL_SYSPM_CB_SYSTEM_LOW</a>),</div>
<div class="line">        .args     = NULL,</div>
<div class="line">        .next     = NULL,</div>
<div class="line">    };</div>
<div class="line"> </div>
<div class="line">    <a class="code hl_function" href="group__group__hal__syspm.html#ga5d1637ece9b27528636981acfc893fd3">cyhal_syspm_register_callback</a>(&amp;callback_data);</div>
<div class="line"> </div>
<div class="line">    <span class="comment">// Attempt to hibernate. This will be rejected by the callback.</span></div>
<div class="line">    rslt = <a class="code hl_function" href="group__group__hal__syspm.html#ga507445e44ab6aae0f4cbaabaec6c5a3f">cyhal_syspm_hibernate</a>(<a class="code hl_enumvalue" href="group__group__hal__syspm.html#gga716955af458772e538910575cbf6e1dda2a495fcdf84252843b6fc9bc4e27206a">CYHAL_SYSPM_HIBERNATE_RTC_ALARM</a>);</div>
<div class="line">    <span class="keywordflow">if</span> (<a class="code hl_define" href="group__group__result.html#gaf58fac450d9fff4472f03ad68f6e546e">CY_RSLT_SUCCESS</a> != rslt)</div>
<div class="line">    {</div>
<div class="line">        <span class="comment">// If couldn&#39;t go to hibernate, try deep sleep.</span></div>
<div class="line">        rslt = <a class="code hl_function" href="group__group__hal__syspm.html#ga0afe7e58c0df4a2eda5010ac628ea981">cyhal_syspm_deepsleep</a>();</div>
<div class="line">    }</div>
<div class="line"> </div>
<div class="line">    <a class="code hl_function" href="group__group__hal__syspm.html#gae069670790199a668edffa9ec01fd538">cyhal_syspm_unregister_callback</a>(&amp;callback_data);</div>
<div class="line">}</div>
<div class="line"> </div>
<div class="line"> </div>
<div class="ttc" id="agroup__group__hal__syspm_html_aacd72d2e829b54c27e98e6495ca4dfd8"><div class="ttname"><a href="group__group__hal__syspm.html#aacd72d2e829b54c27e98e6495ca4dfd8">cyhal_syspm_callback_data_t::callback</a></div><div class="ttdeci">cyhal_syspm_callback_t callback</div><div class="ttdoc">Callback to run on power state change.</div><div class="ttdef"><b>Definition:</b> cyhal_general_types.h:235</div></div>
<div class="ttc" id="agroup__group__hal__syspm_html_ga560aa7873d3131c4eb5d1453711305d2"><div class="ttname"><a href="group__group__hal__syspm.html#ga560aa7873d3131c4eb5d1453711305d2">cyhal_syspm_callback_state_t</a></div><div class="ttdeci">cyhal_syspm_callback_state_t</div><div class="ttdoc">Flags enum for the cpu state in a custom callback.</div><div class="ttdef"><b>Definition:</b> cyhal_general_types.h:175</div></div>
<div class="ttc" id="agroup__group__hal__syspm_html_ga5a6a88eb2b6e35dbea25e36b027bf4ba"><div class="ttname"><a href="group__group__hal__syspm.html#ga5a6a88eb2b6e35dbea25e36b027bf4ba">cyhal_syspm_callback_mode_t</a></div><div class="ttdeci">cyhal_syspm_callback_mode_t</div><div class="ttdoc">Enumeration of the transition modes in custom callback.</div><div class="ttdef"><b>Definition:</b> cyhal_general_types.h:198</div></div>
<div class="ttc" id="agroup__group__hal__syspm_html_ga5d1637ece9b27528636981acfc893fd3"><div class="ttname"><a href="group__group__hal__syspm.html#ga5d1637ece9b27528636981acfc893fd3">cyhal_syspm_register_callback</a></div><div class="ttdeci">void cyhal_syspm_register_callback(cyhal_syspm_callback_data_t *callback_data)</div><div class="ttdoc">Register the specified handler with the power manager to be notified of power state changes.</div></div>
<div class="ttc" id="agroup__group__hal__syspm_html_gae069670790199a668edffa9ec01fd538"><div class="ttname"><a href="group__group__hal__syspm.html#gae069670790199a668edffa9ec01fd538">cyhal_syspm_unregister_callback</a></div><div class="ttdeci">void cyhal_syspm_unregister_callback(cyhal_syspm_callback_data_t *callback_data)</div><div class="ttdoc">Removes the registered handler from the power manager so no future notifications are made.</div></div>
<div class="ttc" id="agroup__group__hal__syspm_html_gga560aa7873d3131c4eb5d1453711305d2ac9de4348b02a53d947ce48bd7bc6922a"><div class="ttname"><a href="group__group__hal__syspm.html#gga560aa7873d3131c4eb5d1453711305d2ac9de4348b02a53d947ce48bd7bc6922a">CYHAL_SYSPM_CB_SYSTEM_HIBERNATE</a></div><div class="ttdeci">@ CYHAL_SYSPM_CB_SYSTEM_HIBERNATE</div><div class="ttdoc">Flag for Hibernate callback.</div><div class="ttdef"><b>Definition:</b> cyhal_general_types.h:179</div></div>
<div class="ttc" id="agroup__group__hal__syspm_html_gga560aa7873d3131c4eb5d1453711305d2af13d1c94115a90b1f9d734ace0017045"><div class="ttname"><a href="group__group__hal__syspm.html#gga560aa7873d3131c4eb5d1453711305d2af13d1c94115a90b1f9d734ace0017045">CYHAL_SYSPM_CB_SYSTEM_LOW</a></div><div class="ttdeci">@ CYHAL_SYSPM_CB_SYSTEM_LOW</div><div class="ttdoc">Flag for Low power mode callback.</div><div class="ttdef"><b>Definition:</b> cyhal_general_types.h:181</div></div>
<div class="ttc" id="agroup__group__hal__syspm_html_gga5a6a88eb2b6e35dbea25e36b027bf4baa190eae9b4e71d4c245038320880dcca3"><div class="ttname"><a href="group__group__hal__syspm.html#gga5a6a88eb2b6e35dbea25e36b027bf4baa190eae9b4e71d4c245038320880dcca3">CYHAL_SYSPM_CHECK_FAIL</a></div><div class="ttdeci">@ CYHAL_SYSPM_CHECK_FAIL</div><div class="ttdoc">Callbacks with this mode are only executed if the callback returned true for CYHAL_SYSPM_CHECK_READY ...</div><div class="ttdef"><b>Definition:</b> cyhal_general_types.h:204</div></div>
<div class="ttc" id="agroup__group__hal__syspm_html_gga5a6a88eb2b6e35dbea25e36b027bf4baa1d8aad9b05d313a22e7666a98414f26d"><div class="ttname"><a href="group__group__hal__syspm.html#gga5a6a88eb2b6e35dbea25e36b027bf4baa1d8aad9b05d313a22e7666a98414f26d">CYHAL_SYSPM_CHECK_READY</a></div><div class="ttdeci">@ CYHAL_SYSPM_CHECK_READY</div><div class="ttdoc">Callbacks with this mode are executed before entering into the low power mode.</div><div class="ttdef"><b>Definition:</b> cyhal_general_types.h:199</div></div>
<div class="ttc" id="agroup__group__hal__syspm_html_gga5a6a88eb2b6e35dbea25e36b027bf4baa229203f249d95cf1cac7414c1baf66f3"><div class="ttname"><a href="group__group__hal__syspm.html#gga5a6a88eb2b6e35dbea25e36b027bf4baa229203f249d95cf1cac7414c1baf66f3">CYHAL_SYSPM_AFTER_DS_WFI_TRANSITION</a></div><div class="ttdeci">@ CYHAL_SYSPM_AFTER_DS_WFI_TRANSITION</div><div class="ttdoc">Performs the actions to be done after exiting the Deepsleep low power mode if entered and before the ...</div><div class="ttdef"><b>Definition:</b> cyhal_general_types.h:213</div></div>
<div class="ttc" id="agroup__group__hal__syspm_html_gga5a6a88eb2b6e35dbea25e36b027bf4baadd83c77cb81d9d4aafef1d094e6c4e71"><div class="ttname"><a href="group__group__hal__syspm.html#gga5a6a88eb2b6e35dbea25e36b027bf4baadd83c77cb81d9d4aafef1d094e6c4e71">CYHAL_SYSPM_BEFORE_TRANSITION</a></div><div class="ttdeci">@ CYHAL_SYSPM_BEFORE_TRANSITION</div><div class="ttdoc">Callbacks with this mode are executed after the CYHAL_SYSPM_CHECK_READY callbacks' execution returns ...</div><div class="ttdef"><b>Definition:</b> cyhal_general_types.h:208</div></div>
<div class="ttc" id="agroup__group__hal__syspm_html_gga5a6a88eb2b6e35dbea25e36b027bf4baaf6a195dbd042da0bffc35b9161ca49e6"><div class="ttname"><a href="group__group__hal__syspm.html#gga5a6a88eb2b6e35dbea25e36b027bf4baaf6a195dbd042da0bffc35b9161ca49e6">CYHAL_SYSPM_AFTER_TRANSITION</a></div><div class="ttdeci">@ CYHAL_SYSPM_AFTER_TRANSITION</div><div class="ttdoc">In this mode, the application must perform the actions to be done after exiting the low power mode.</div><div class="ttdef"><b>Definition:</b> cyhal_general_types.h:211</div></div>
<div class="ttc" id="agroup__group__hal__syspm_html_gga716955af458772e538910575cbf6e1dda2a495fcdf84252843b6fc9bc4e27206a"><div class="ttname"><a href="group__group__hal__syspm.html#gga716955af458772e538910575cbf6e1dda2a495fcdf84252843b6fc9bc4e27206a">CYHAL_SYSPM_HIBERNATE_RTC_ALARM</a></div><div class="ttdeci">@ CYHAL_SYSPM_HIBERNATE_RTC_ALARM</div><div class="ttdoc">Configure the RTC alarm as wakeup source.</div><div class="ttdef"><b>Definition:</b> cyhal_syspm.h:231</div></div>
<div class="ttc" id="agroup__group__hal__syspm_html_structcyhal__syspm__callback__data__t"><div class="ttname"><a href="group__group__hal__syspm.html#structcyhal__syspm__callback__data__t">cyhal_syspm_callback_data_t</a></div><div class="ttdoc">Power management callback data object.</div><div class="ttdef"><b>Definition:</b> cyhal_general_types.h:233</div></div>
<div class="ttc" id="agroup__group__result_html_gaf58fac450d9fff4472f03ad68f6e546e"><div class="ttname"><a href="group__group__result.html#gaf58fac450d9fff4472f03ad68f6e546e">CY_RSLT_SUCCESS</a></div><div class="ttdeci">#define CY_RSLT_SUCCESS</div><div class="ttdoc">cy_rslt_t return value indicating success</div><div class="ttdef"><b>Definition:</b> cy_result.h:465</div></div>
</div><!-- fragment --> <table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="groups" name="groups"></a>
API Reference</h2></td></tr>
<tr class="memitem:group__group__hal__results__syspm"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__results__syspm.html">SYSPM HAL Results</a></td></tr>
<tr class="memdesc:group__group__hal__results__syspm"><td class="mdescLeft">&#160;</td><td class="mdescRight">SYSPM specific return codes. <br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="nested-classes" name="nested-classes"></a>
Data Structures</h2></td></tr>
<tr class="memitem:structcyhal__syspm__callback__data__t"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__syspm.html#structcyhal__syspm__callback__data__t">cyhal_syspm_callback_data_t</a></td></tr>
<tr class="memdesc:structcyhal__syspm__callback__data__t"><td class="mdescLeft">&#160;</td><td class="mdescRight">Power management callback data object.  <a href="group__group__hal__syspm.html#structcyhal__syspm__callback__data__t">More...</a><br /></td></tr>
<tr class="separator:structcyhal__syspm__callback__data__t"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="define-members" name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:ga76ba531d277abb20e430874026756664"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__syspm.html#ga76ba531d277abb20e430874026756664">CYHAL_SYSPM_CALLBACK_STATE_ALL</a></td></tr>
<tr class="memdesc:ga76ba531d277abb20e430874026756664"><td class="mdescLeft">&#160;</td><td class="mdescRight">Define for enabling all system and MCU state callbacks .  <a href="group__group__hal__syspm.html#ga76ba531d277abb20e430874026756664">More...</a><br /></td></tr>
<tr class="separator:ga76ba531d277abb20e430874026756664"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga468602279a080cb8c956cb6338f740da"><td class="memItemLeft" align="right" valign="top"><a id="ga468602279a080cb8c956cb6338f740da" name="ga468602279a080cb8c956cb6338f740da"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>CYHAL_API_AVAILABLE_SYSPM_GET_DEEPSLEEP_MODE</b></td></tr>
<tr class="memdesc:ga468602279a080cb8c956cb6338f740da"><td class="mdescLeft">&#160;</td><td class="mdescRight">Indicates, that <a class="el" href="group__group__hal__syspm.html#ga60a496432477ed130a5549550009bc61">cyhal_syspm_get_deepsleep_mode</a> function is available in this version of HAL. <br /></td></tr>
<tr class="separator:ga468602279a080cb8c956cb6338f740da"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gad48a7dca8c53a68ee898e72f2c4cc675"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__syspm.html#gad48a7dca8c53a68ee898e72f2c4cc675">cyhal_syspm_set_supply_voltage</a>(supply,  mvolts)&#160;&#160;&#160;<a class="el" href="group__group__hal__system.html#ga2338e3ad7fac5762523f4f5c473c86a3">cyhal_system_set_supply_voltage</a>((supply), (mvolts))</td></tr>
<tr class="memdesc:gad48a7dca8c53a68ee898e72f2c4cc675"><td class="mdescLeft">&#160;</td><td class="mdescRight">Informs the system of the current voltage level on the specified supply.  <a href="group__group__hal__syspm.html#gad48a7dca8c53a68ee898e72f2c4cc675">More...</a><br /></td></tr>
<tr class="separator:gad48a7dca8c53a68ee898e72f2c4cc675"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga60255eda7ce90dcda24a7d4668585d37"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__syspm.html#ga60255eda7ce90dcda24a7d4668585d37">cyhal_syspm_get_supply_voltage</a>(supply)&#160;&#160;&#160;<a class="el" href="group__group__hal__system.html#ga1ceb538fd488a22132ab2153280ade6b">cyhal_system_get_supply_voltage</a>((supply))</td></tr>
<tr class="memdesc:ga60255eda7ce90dcda24a7d4668585d37"><td class="mdescLeft">&#160;</td><td class="mdescRight">Retrieves the current voltage level on the specified supply, as set in <a class="el" href="group__group__hal__system.html#ga2338e3ad7fac5762523f4f5c473c86a3">cyhal_system_set_supply_voltage</a>.  <a href="group__group__hal__syspm.html#ga60255eda7ce90dcda24a7d4668585d37">More...</a><br /></td></tr>
<tr class="separator:ga60255eda7ce90dcda24a7d4668585d37"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="typedef-members" name="typedef-members"></a>
Typedefs</h2></td></tr>
<tr class="memitem:ga19c98edec42da617e97eb09ea9292514"><td class="memItemLeft" align="right" valign="top">typedef bool(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__syspm.html#ga19c98edec42da617e97eb09ea9292514">cyhal_syspm_callback_t</a>) (<a class="el" href="group__group__hal__syspm.html#ga560aa7873d3131c4eb5d1453711305d2">cyhal_syspm_callback_state_t</a> state, <a class="el" href="group__group__hal__syspm.html#ga5a6a88eb2b6e35dbea25e36b027bf4ba">cyhal_syspm_callback_mode_t</a> mode, void *callback_arg)</td></tr>
<tr class="memdesc:ga19c98edec42da617e97eb09ea9292514"><td class="mdescLeft">&#160;</td><td class="mdescRight">The system wide custom action power callback type.  <a href="group__group__hal__syspm.html#ga19c98edec42da617e97eb09ea9292514">More...</a><br /></td></tr>
<tr class="separator:ga19c98edec42da617e97eb09ea9292514"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="enum-members" name="enum-members"></a>
Enumerations</h2></td></tr>
<tr class="memitem:ga560aa7873d3131c4eb5d1453711305d2"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__syspm.html#ga560aa7873d3131c4eb5d1453711305d2">cyhal_syspm_callback_state_t</a> { <br />
&#160;&#160;<a class="el" href="group__group__hal__syspm.html#gga560aa7873d3131c4eb5d1453711305d2a30f5d217aded3c5525b1d9cea03ac5a8">CYHAL_SYSPM_CB_CPU_SLEEP</a> = 0x01U
, <br />
&#160;&#160;<a class="el" href="group__group__hal__syspm.html#gga560aa7873d3131c4eb5d1453711305d2aeaae71eba11b9c861e4a86a6f5c0f2aa">CYHAL_SYSPM_CB_CPU_DEEPSLEEP</a> = 0x02U
, <br />
&#160;&#160;<a class="el" href="group__group__hal__syspm.html#gga560aa7873d3131c4eb5d1453711305d2af1a90dd70e5455e36edb783c060a4a98">CYHAL_SYSPM_CB_CPU_DEEPSLEEP_RAM</a> = 0x04U
, <br />
&#160;&#160;<a class="el" href="group__group__hal__syspm.html#gga560aa7873d3131c4eb5d1453711305d2ac9de4348b02a53d947ce48bd7bc6922a">CYHAL_SYSPM_CB_SYSTEM_HIBERNATE</a> = 0x08U
, <br />
&#160;&#160;<a class="el" href="group__group__hal__syspm.html#gga560aa7873d3131c4eb5d1453711305d2aca71bfa3460ce92a9eed50dace3b8b5a">CYHAL_SYSPM_CB_SYSTEM_NORMAL</a> = 0x10U
, <br />
&#160;&#160;<a class="el" href="group__group__hal__syspm.html#gga560aa7873d3131c4eb5d1453711305d2af13d1c94115a90b1f9d734ace0017045">CYHAL_SYSPM_CB_SYSTEM_LOW</a> = 0x20U
<br />
 }</td></tr>
<tr class="memdesc:ga560aa7873d3131c4eb5d1453711305d2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Flags enum for the cpu state in a custom callback.  <a href="group__group__hal__syspm.html#ga560aa7873d3131c4eb5d1453711305d2">More...</a><br /></td></tr>
<tr class="separator:ga560aa7873d3131c4eb5d1453711305d2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga5a6a88eb2b6e35dbea25e36b027bf4ba"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__syspm.html#ga5a6a88eb2b6e35dbea25e36b027bf4ba">cyhal_syspm_callback_mode_t</a> { <br />
&#160;&#160;<a class="el" href="group__group__hal__syspm.html#gga5a6a88eb2b6e35dbea25e36b027bf4baa1d8aad9b05d313a22e7666a98414f26d">CYHAL_SYSPM_CHECK_READY</a> = 0x01U
, <br />
&#160;&#160;<a class="el" href="group__group__hal__syspm.html#gga5a6a88eb2b6e35dbea25e36b027bf4baa190eae9b4e71d4c245038320880dcca3">CYHAL_SYSPM_CHECK_FAIL</a> = 0x02U
, <br />
&#160;&#160;<a class="el" href="group__group__hal__syspm.html#gga5a6a88eb2b6e35dbea25e36b027bf4baadd83c77cb81d9d4aafef1d094e6c4e71">CYHAL_SYSPM_BEFORE_TRANSITION</a> = 0x04U
, <br />
&#160;&#160;<a class="el" href="group__group__hal__syspm.html#gga5a6a88eb2b6e35dbea25e36b027bf4baaf6a195dbd042da0bffc35b9161ca49e6">CYHAL_SYSPM_AFTER_TRANSITION</a> = 0x08U
, <br />
&#160;&#160;<a class="el" href="group__group__hal__syspm.html#gga5a6a88eb2b6e35dbea25e36b027bf4baa229203f249d95cf1cac7414c1baf66f3">CYHAL_SYSPM_AFTER_DS_WFI_TRANSITION</a> = 0x10U
<br />
 }</td></tr>
<tr class="memdesc:ga5a6a88eb2b6e35dbea25e36b027bf4ba"><td class="mdescLeft">&#160;</td><td class="mdescRight">Enumeration of the transition modes in custom callback.  <a href="group__group__hal__syspm.html#ga5a6a88eb2b6e35dbea25e36b027bf4ba">More...</a><br /></td></tr>
<tr class="separator:ga5a6a88eb2b6e35dbea25e36b027bf4ba"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga144e474d3bfb544b207f172d1d8bd633"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__syspm.html#ga144e474d3bfb544b207f172d1d8bd633">cyhal_syspm_system_state_t</a> { <br />
&#160;&#160;<a class="el" href="group__group__hal__syspm.html#gga144e474d3bfb544b207f172d1d8bd633acd2a5522b6591eb77418369e464a3eb1">CYHAL_SYSPM_SYSTEM_NORMAL</a>
, <br />
&#160;&#160;<a class="el" href="group__group__hal__syspm.html#gga144e474d3bfb544b207f172d1d8bd633af4060b98561e43a6b930576644af014f">CYHAL_SYSPM_SYSTEM_LOW</a>
<br />
 }</td></tr>
<tr class="memdesc:ga144e474d3bfb544b207f172d1d8bd633"><td class="mdescLeft">&#160;</td><td class="mdescRight">Enumeration of the system wide power modes.  <a href="group__group__hal__syspm.html#ga144e474d3bfb544b207f172d1d8bd633">More...</a><br /></td></tr>
<tr class="separator:ga144e474d3bfb544b207f172d1d8bd633"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga624438ff56f764659e2afa62b7eafba0"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__syspm.html#ga624438ff56f764659e2afa62b7eafba0">cyhal_syspm_system_deep_sleep_mode_t</a> { <br />
&#160;&#160;<a class="el" href="group__group__hal__syspm.html#gga624438ff56f764659e2afa62b7eafba0afffaf708d36fcd3a37cc23a009090a7d">CYHAL_SYSPM_SYSTEM_DEEPSLEEP_NONE</a>
, <br />
&#160;&#160;<a class="el" href="group__group__hal__syspm.html#gga624438ff56f764659e2afa62b7eafba0a052a17cb28779a2cdf08776f6ccb20a1">CYHAL_SYSPM_SYSTEM_DEEPSLEEP</a>
, <br />
&#160;&#160;<a class="el" href="group__group__hal__syspm.html#gga624438ff56f764659e2afa62b7eafba0a7e34e297ecd6710c7b6eb1237fdc5abe">CYHAL_SYSPM_SYSTEM_DEEPSLEEP_RAM</a>
, <br />
&#160;&#160;<a class="el" href="group__group__hal__syspm.html#gga624438ff56f764659e2afa62b7eafba0a0a6ced1a860c896bd94508f8af2e99f0">CYHAL_SYSPM_SYSTEM_DEEPSLEEP_OFF</a>
<br />
 }</td></tr>
<tr class="memdesc:ga624438ff56f764659e2afa62b7eafba0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Enumeration of the system Deep Sleep modes.  <a href="group__group__hal__syspm.html#ga624438ff56f764659e2afa62b7eafba0">More...</a><br /></td></tr>
<tr class="separator:ga624438ff56f764659e2afa62b7eafba0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga716955af458772e538910575cbf6e1dd"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__syspm.html#ga716955af458772e538910575cbf6e1dd">cyhal_syspm_hibernate_source_t</a> { <br />
&#160;&#160;<a class="el" href="group__group__hal__syspm.html#gga716955af458772e538910575cbf6e1dda57c81752ef79a93b9a9701c59a8b35e3">CYHAL_SYSPM_HIBERNATE_LPCOMP0_LOW</a> = 0x01U
, <br />
&#160;&#160;<a class="el" href="group__group__hal__syspm.html#gga716955af458772e538910575cbf6e1dda765ef14d1cc8c55710c122b77798204b">CYHAL_SYSPM_HIBERNATE_LPCOMP0_HIGH</a> = 0x02U
, <br />
&#160;&#160;<a class="el" href="group__group__hal__syspm.html#gga716955af458772e538910575cbf6e1dda0a4d1ab39bb8cbece570a555971bcd99">CYHAL_SYSPM_HIBERNATE_LPCOMP1_LOW</a> = 0x04U
, <br />
&#160;&#160;<a class="el" href="group__group__hal__syspm.html#gga716955af458772e538910575cbf6e1dda46ab6d77f810acb319caff3616a8f88c">CYHAL_SYSPM_HIBERNATE_LPCOMP1_HIGH</a> = 0x08U
, <br />
&#160;&#160;<a class="el" href="group__group__hal__syspm.html#gga716955af458772e538910575cbf6e1dda2a495fcdf84252843b6fc9bc4e27206a">CYHAL_SYSPM_HIBERNATE_RTC_ALARM</a> = 0x10U
, <br />
&#160;&#160;<a class="el" href="group__group__hal__syspm.html#gga716955af458772e538910575cbf6e1dda519c726a562e214bd1694137e62a22e1">CYHAL_SYSPM_HIBERNATE_WDT</a> = 0x20U
, <br />
&#160;&#160;<a class="el" href="group__group__hal__syspm.html#gga716955af458772e538910575cbf6e1dda9ccdbb4f654ce023bea0fafba50cab53">CYHAL_SYSPM_HIBERNATE_PINA_LOW</a> = 0x40U
, <br />
&#160;&#160;<a class="el" href="group__group__hal__syspm.html#gga716955af458772e538910575cbf6e1dda0882eed07391eb7773ea2f4c47a7b5ff">CYHAL_SYSPM_HIBERNATE_PINA_HIGH</a> = 0x80U
, <br />
&#160;&#160;<a class="el" href="group__group__hal__syspm.html#gga716955af458772e538910575cbf6e1dda1bf3cfcfb69b48e6b0ef5a525cc6eb3d">CYHAL_SYSPM_HIBERNATE_PINB_LOW</a> = 0x100U
, <br />
&#160;&#160;<a class="el" href="group__group__hal__syspm.html#gga716955af458772e538910575cbf6e1dda69f639b3f33245d1a789fd443b94b47d">CYHAL_SYSPM_HIBERNATE_PINB_HIGH</a> = 0x200U
<br />
 }</td></tr>
<tr class="memdesc:ga716955af458772e538910575cbf6e1dd"><td class="mdescLeft">&#160;</td><td class="mdescRight">Flags enum for the hibernate wakeup sources.  <a href="group__group__hal__syspm.html#ga716955af458772e538910575cbf6e1dd">More...</a><br /></td></tr>
<tr class="separator:ga716955af458772e538910575cbf6e1dd"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ga299e36096b0ad36b29afe3c5bb02a6d7"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__syspm.html#ga299e36096b0ad36b29afe3c5bb02a6d7">cyhal_syspm_init</a> (void)</td></tr>
<tr class="memdesc:ga299e36096b0ad36b29afe3c5bb02a6d7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Performs any system wide power management initialization that is needed for future operations.  <a href="group__group__hal__syspm.html#ga299e36096b0ad36b29afe3c5bb02a6d7">More...</a><br /></td></tr>
<tr class="separator:ga299e36096b0ad36b29afe3c5bb02a6d7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga507445e44ab6aae0f4cbaabaec6c5a3f"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__syspm.html#ga507445e44ab6aae0f4cbaabaec6c5a3f">cyhal_syspm_hibernate</a> (<a class="el" href="group__group__hal__syspm.html#ga716955af458772e538910575cbf6e1dd">cyhal_syspm_hibernate_source_t</a> wakeup_source)</td></tr>
<tr class="memdesc:ga507445e44ab6aae0f4cbaabaec6c5a3f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the system mode to hibernate.  <a href="group__group__hal__syspm.html#ga507445e44ab6aae0f4cbaabaec6c5a3f">More...</a><br /></td></tr>
<tr class="separator:ga507445e44ab6aae0f4cbaabaec6c5a3f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaae0157682bad1b2155738e73347afa87"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__syspm.html#gaae0157682bad1b2155738e73347afa87">cyhal_syspm_set_system_state</a> (<a class="el" href="group__group__hal__syspm.html#ga144e474d3bfb544b207f172d1d8bd633">cyhal_syspm_system_state_t</a> state)</td></tr>
<tr class="memdesc:gaae0157682bad1b2155738e73347afa87"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set the system-wide state of the device.  <a href="group__group__hal__syspm.html#gaae0157682bad1b2155738e73347afa87">More...</a><br /></td></tr>
<tr class="separator:gaae0157682bad1b2155738e73347afa87"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaaf3fe209bb106f490f207394bb35043a"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__hal__syspm.html#ga144e474d3bfb544b207f172d1d8bd633">cyhal_syspm_system_state_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__syspm.html#gaaf3fe209bb106f490f207394bb35043a">cyhal_syspm_get_system_state</a> (void)</td></tr>
<tr class="memdesc:gaaf3fe209bb106f490f207394bb35043a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Gets the system-wide state of the device.  <a href="group__group__hal__syspm.html#gaaf3fe209bb106f490f207394bb35043a">More...</a><br /></td></tr>
<tr class="separator:gaaf3fe209bb106f490f207394bb35043a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga5d1637ece9b27528636981acfc893fd3"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__syspm.html#ga5d1637ece9b27528636981acfc893fd3">cyhal_syspm_register_callback</a> (<a class="el" href="group__group__hal__syspm.html#structcyhal__syspm__callback__data__t">cyhal_syspm_callback_data_t</a> *callback_data)</td></tr>
<tr class="memdesc:ga5d1637ece9b27528636981acfc893fd3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Register the specified handler with the power manager to be notified of power state changes.  <a href="group__group__hal__syspm.html#ga5d1637ece9b27528636981acfc893fd3">More...</a><br /></td></tr>
<tr class="separator:ga5d1637ece9b27528636981acfc893fd3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gae069670790199a668edffa9ec01fd538"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__syspm.html#gae069670790199a668edffa9ec01fd538">cyhal_syspm_unregister_callback</a> (<a class="el" href="group__group__hal__syspm.html#structcyhal__syspm__callback__data__t">cyhal_syspm_callback_data_t</a> *callback_data)</td></tr>
<tr class="memdesc:gae069670790199a668edffa9ec01fd538"><td class="mdescLeft">&#160;</td><td class="mdescRight">Removes the registered handler from the power manager so no future notifications are made.  <a href="group__group__hal__syspm.html#gae069670790199a668edffa9ec01fd538">More...</a><br /></td></tr>
<tr class="separator:gae069670790199a668edffa9ec01fd538"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gac3e07ce98d215865b0f7f0149073bae2"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__syspm.html#gac3e07ce98d215865b0f7f0149073bae2">cyhal_syspm_sleep</a> (void)</td></tr>
<tr class="memdesc:gac3e07ce98d215865b0f7f0149073bae2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set CPU to sleep mode.  <a href="group__group__hal__syspm.html#gac3e07ce98d215865b0f7f0149073bae2">More...</a><br /></td></tr>
<tr class="separator:gac3e07ce98d215865b0f7f0149073bae2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga0afe7e58c0df4a2eda5010ac628ea981"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__syspm.html#ga0afe7e58c0df4a2eda5010ac628ea981">cyhal_syspm_deepsleep</a> (void)</td></tr>
<tr class="memdesc:ga0afe7e58c0df4a2eda5010ac628ea981"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set CPU to deep sleep mode.  <a href="group__group__hal__syspm.html#ga0afe7e58c0df4a2eda5010ac628ea981">More...</a><br /></td></tr>
<tr class="separator:ga0afe7e58c0df4a2eda5010ac628ea981"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga3568214a6038240239f99768fe6707d6"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__syspm.html#ga3568214a6038240239f99768fe6707d6">cyhal_syspm_lock_deepsleep</a> (void)</td></tr>
<tr class="memdesc:ga3568214a6038240239f99768fe6707d6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Lock deep sleep.  <a href="group__group__hal__syspm.html#ga3568214a6038240239f99768fe6707d6">More...</a><br /></td></tr>
<tr class="separator:ga3568214a6038240239f99768fe6707d6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga028b85f03d4607ccac8494b46ec8413c"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__syspm.html#ga028b85f03d4607ccac8494b46ec8413c">cyhal_syspm_unlock_deepsleep</a> (void)</td></tr>
<tr class="memdesc:ga028b85f03d4607ccac8494b46ec8413c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Unlock deep sleep.  <a href="group__group__hal__syspm.html#ga028b85f03d4607ccac8494b46ec8413c">More...</a><br /></td></tr>
<tr class="separator:ga028b85f03d4607ccac8494b46ec8413c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga2bbc7d6e2727228629d7e485ed9a6565"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__syspm.html#ga2bbc7d6e2727228629d7e485ed9a6565">cyhal_syspm_tickless_deepsleep</a> (<a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__lptimer__t">cyhal_lptimer_t</a> *lptimer_obj, uint32_t desired_ms, uint32_t *actual_ms)</td></tr>
<tr class="memdesc:ga2bbc7d6e2727228629d7e485ed9a6565"><td class="mdescLeft">&#160;</td><td class="mdescRight">Timed deep-sleep without system timer.  <a href="group__group__hal__syspm.html#ga2bbc7d6e2727228629d7e485ed9a6565">More...</a><br /></td></tr>
<tr class="separator:ga2bbc7d6e2727228629d7e485ed9a6565"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gadc3bb2e5eff7491f79585034bbe99cb0"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__syspm.html#gadc3bb2e5eff7491f79585034bbe99cb0">cyhal_syspm_tickless_sleep</a> (<a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__lptimer__t">cyhal_lptimer_t</a> *lptimer_obj, uint32_t desired_ms, uint32_t *actual_ms)</td></tr>
<tr class="memdesc:gadc3bb2e5eff7491f79585034bbe99cb0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Timed sleep without system timer.  <a href="group__group__hal__syspm.html#gadc3bb2e5eff7491f79585034bbe99cb0">More...</a><br /></td></tr>
<tr class="separator:gadc3bb2e5eff7491f79585034bbe99cb0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga60a496432477ed130a5549550009bc61"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__hal__syspm.html#ga624438ff56f764659e2afa62b7eafba0">cyhal_syspm_system_deep_sleep_mode_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__syspm.html#ga60a496432477ed130a5549550009bc61">cyhal_syspm_get_deepsleep_mode</a> (void)</td></tr>
<tr class="memdesc:ga60a496432477ed130a5549550009bc61"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get current deep sleep mode.  <a href="group__group__hal__syspm.html#ga60a496432477ed130a5549550009bc61">More...</a><br /></td></tr>
<tr class="separator:ga60a496432477ed130a5549550009bc61"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<hr/><h2 class="groupheader">Data Structure Documentation</h2>
<a name="structcyhal__syspm__callback__data__t" id="structcyhal__syspm__callback__data__t"></a>
<h2 class="memtitle"><span class="permalink"><a href="#structcyhal__syspm__callback__data__t">&#9670;&nbsp;</a></span>cyhal_syspm_callback_data_t</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">struct cyhal_syspm_callback_data_t</td>
        </tr>
      </table>
</div><div class="memdoc">
<table class="fieldtable">
<tr><th colspan="3">Data Fields</th></tr>
<tr><td class="fieldtype">
<a id="aacd72d2e829b54c27e98e6495ca4dfd8" name="aacd72d2e829b54c27e98e6495ca4dfd8"></a><a class="el" href="group__group__hal__syspm.html#ga19c98edec42da617e97eb09ea9292514">cyhal_syspm_callback_t</a></td>
<td class="fieldname">
callback</td>
<td class="fielddoc">
Callback to run on power state change. </td></tr>
<tr><td class="fieldtype">
<a id="a30d05805c7003766b01d970c6c5519ea" name="a30d05805c7003766b01d970c6c5519ea"></a><a class="el" href="group__group__hal__syspm.html#ga560aa7873d3131c4eb5d1453711305d2">cyhal_syspm_callback_state_t</a></td>
<td class="fieldname">
states</td>
<td class="fielddoc">
Power states that should trigger calling the callback. <p >Multiple <a class="el" href="group__group__hal__syspm.html#ga560aa7873d3131c4eb5d1453711305d2">cyhal_syspm_callback_state_t</a> values can be ored together. </p>
</td></tr>
<tr><td class="fieldtype">
<a id="a0a5827d8c4bb7f81086fdfc02a2e5067" name="a0a5827d8c4bb7f81086fdfc02a2e5067"></a><a class="el" href="group__group__hal__syspm.html#ga5a6a88eb2b6e35dbea25e36b027bf4ba">cyhal_syspm_callback_mode_t</a></td>
<td class="fieldname">
ignore_modes</td>
<td class="fielddoc">
Modes to ignore invoking the callback for. <p >Multiple <a class="el" href="group__group__hal__syspm.html#ga5a6a88eb2b6e35dbea25e36b027bf4ba">cyhal_syspm_callback_mode_t</a> values can be ored together. </p>
</td></tr>
<tr><td class="fieldtype">
<a id="ab1f15be2024fd41fc51683a1aa04e8cf" name="ab1f15be2024fd41fc51683a1aa04e8cf"></a>void *</td>
<td class="fieldname">
args</td>
<td class="fielddoc">
Argument value to provide to the callback. </td></tr>
<tr><td class="fieldtype">
<a id="a7cf9d47efae150366d250371f113ae6c" name="a7cf9d47efae150366d250371f113ae6c"></a>struct cyhal_syspm_callback_data *</td>
<td class="fieldname">
next</td>
<td class="fielddoc">
Pointer to the next callback strucure. <p >This should be initialized to NULL. </p>
</td></tr>
</table>

</div>
</div>
<h2 class="groupheader">Macro Definition Documentation</h2>
<a id="ga76ba531d277abb20e430874026756664" name="ga76ba531d277abb20e430874026756664"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga76ba531d277abb20e430874026756664">&#9670;&nbsp;</a></span>CYHAL_SYSPM_CALLBACK_STATE_ALL</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define CYHAL_SYSPM_CALLBACK_STATE_ALL</td>
        </tr>
      </table>
</div><div class="memdoc">
<b>Value:</b><div class="fragment"><div class="line">                                        (<a class="code hl_enumvalue" href="group__group__hal__syspm.html#gga560aa7873d3131c4eb5d1453711305d2a30f5d217aded3c5525b1d9cea03ac5a8">CYHAL_SYSPM_CB_CPU_SLEEP</a>\</div>
<div class="line">                                        | <a class="code hl_enumvalue" href="group__group__hal__syspm.html#gga560aa7873d3131c4eb5d1453711305d2aeaae71eba11b9c861e4a86a6f5c0f2aa">CYHAL_SYSPM_CB_CPU_DEEPSLEEP</a>\</div>
<div class="line">                                        | <a class="code hl_enumvalue" href="group__group__hal__syspm.html#gga560aa7873d3131c4eb5d1453711305d2af1a90dd70e5455e36edb783c060a4a98">CYHAL_SYSPM_CB_CPU_DEEPSLEEP_RAM</a>\</div>
<div class="line">                                        | <a class="code hl_enumvalue" href="group__group__hal__syspm.html#gga560aa7873d3131c4eb5d1453711305d2ac9de4348b02a53d947ce48bd7bc6922a">CYHAL_SYSPM_CB_SYSTEM_HIBERNATE</a>\</div>
<div class="line">                                        | <a class="code hl_enumvalue" href="group__group__hal__syspm.html#gga560aa7873d3131c4eb5d1453711305d2aca71bfa3460ce92a9eed50dace3b8b5a">CYHAL_SYSPM_CB_SYSTEM_NORMAL</a>\</div>
<div class="line">                                        | <a class="code hl_enumvalue" href="group__group__hal__syspm.html#gga560aa7873d3131c4eb5d1453711305d2af13d1c94115a90b1f9d734ace0017045">CYHAL_SYSPM_CB_SYSTEM_LOW</a>)</div>
<div class="ttc" id="agroup__group__hal__syspm_html_gga560aa7873d3131c4eb5d1453711305d2a30f5d217aded3c5525b1d9cea03ac5a8"><div class="ttname"><a href="group__group__hal__syspm.html#gga560aa7873d3131c4eb5d1453711305d2a30f5d217aded3c5525b1d9cea03ac5a8">CYHAL_SYSPM_CB_CPU_SLEEP</a></div><div class="ttdeci">@ CYHAL_SYSPM_CB_CPU_SLEEP</div><div class="ttdoc">Flag for MCU sleep callback.</div><div class="ttdef"><b>Definition:</b> cyhal_general_types.h:176</div></div>
<div class="ttc" id="agroup__group__hal__syspm_html_gga560aa7873d3131c4eb5d1453711305d2aca71bfa3460ce92a9eed50dace3b8b5a"><div class="ttname"><a href="group__group__hal__syspm.html#gga560aa7873d3131c4eb5d1453711305d2aca71bfa3460ce92a9eed50dace3b8b5a">CYHAL_SYSPM_CB_SYSTEM_NORMAL</a></div><div class="ttdeci">@ CYHAL_SYSPM_CB_SYSTEM_NORMAL</div><div class="ttdoc">Flag for Normal mode callback.</div><div class="ttdef"><b>Definition:</b> cyhal_general_types.h:180</div></div>
<div class="ttc" id="agroup__group__hal__syspm_html_gga560aa7873d3131c4eb5d1453711305d2aeaae71eba11b9c861e4a86a6f5c0f2aa"><div class="ttname"><a href="group__group__hal__syspm.html#gga560aa7873d3131c4eb5d1453711305d2aeaae71eba11b9c861e4a86a6f5c0f2aa">CYHAL_SYSPM_CB_CPU_DEEPSLEEP</a></div><div class="ttdeci">@ CYHAL_SYSPM_CB_CPU_DEEPSLEEP</div><div class="ttdoc">Flag for MCU deep sleep callback.</div><div class="ttdef"><b>Definition:</b> cyhal_general_types.h:177</div></div>
<div class="ttc" id="agroup__group__hal__syspm_html_gga560aa7873d3131c4eb5d1453711305d2af1a90dd70e5455e36edb783c060a4a98"><div class="ttname"><a href="group__group__hal__syspm.html#gga560aa7873d3131c4eb5d1453711305d2af1a90dd70e5455e36edb783c060a4a98">CYHAL_SYSPM_CB_CPU_DEEPSLEEP_RAM</a></div><div class="ttdeci">@ CYHAL_SYSPM_CB_CPU_DEEPSLEEP_RAM</div><div class="ttdoc">Flag for MCU deep sleep ram callback.</div><div class="ttdef"><b>Definition:</b> cyhal_general_types.h:178</div></div>
</div><!-- fragment -->
<p>Define for enabling all system and MCU state callbacks . </p>

</div>
</div>
<a id="gad48a7dca8c53a68ee898e72f2c4cc675" name="gad48a7dca8c53a68ee898e72f2c4cc675"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gad48a7dca8c53a68ee898e72f2c4cc675">&#9670;&nbsp;</a></span>cyhal_syspm_set_supply_voltage</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define cyhal_syspm_set_supply_voltage</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">supply, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">mvolts&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td>&#160;&#160;&#160;<a class="el" href="group__group__hal__system.html#ga2338e3ad7fac5762523f4f5c473c86a3">cyhal_system_set_supply_voltage</a>((supply), (mvolts))</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Informs the system of the current voltage level on the specified supply. </p>
<p >Deprecated, see cyhal_system_set_supply_voltage </p>

</div>
</div>
<a id="ga60255eda7ce90dcda24a7d4668585d37" name="ga60255eda7ce90dcda24a7d4668585d37"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga60255eda7ce90dcda24a7d4668585d37">&#9670;&nbsp;</a></span>cyhal_syspm_get_supply_voltage</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define cyhal_syspm_get_supply_voltage</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">supply</td><td>)</td>
          <td>&#160;&#160;&#160;<a class="el" href="group__group__hal__system.html#ga1ceb538fd488a22132ab2153280ade6b">cyhal_system_get_supply_voltage</a>((supply))</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Retrieves the current voltage level on the specified supply, as set in <a class="el" href="group__group__hal__system.html#ga2338e3ad7fac5762523f4f5c473c86a3">cyhal_system_set_supply_voltage</a>. </p>
<p >Deprecated, see cyhal_system_get_supply_voltage </p>

</div>
</div>
<h2 class="groupheader">Typedef Documentation</h2>
<a id="ga19c98edec42da617e97eb09ea9292514" name="ga19c98edec42da617e97eb09ea9292514"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga19c98edec42da617e97eb09ea9292514">&#9670;&nbsp;</a></span>cyhal_syspm_callback_t</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef bool(* cyhal_syspm_callback_t) (<a class="el" href="group__group__hal__syspm.html#ga560aa7873d3131c4eb5d1453711305d2">cyhal_syspm_callback_state_t</a> state, <a class="el" href="group__group__hal__syspm.html#ga5a6a88eb2b6e35dbea25e36b027bf4ba">cyhal_syspm_callback_mode_t</a> mode, void *callback_arg)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>The system wide custom action power callback type. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">state</td><td>State the system or CPU is being transitioned into. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">mode</td><td>Callback mode. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">callback_arg</td><td>User argument passed as part of registering callback in <a class="el" href="group__group__hal__syspm.html#ga5d1637ece9b27528636981acfc893fd3">cyhal_syspm_register_callback</a>. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>If mode is <a class="el" href="group__group__hal__syspm.html#gga5a6a88eb2b6e35dbea25e36b027bf4baa1d8aad9b05d313a22e7666a98414f26d">CYHAL_SYSPM_CHECK_READY</a>, then this indicates whether the low power mode should be allowed (true) or not (false). Otherwise the return value is ignored. </dd></dl>

</div>
</div>
<h2 class="groupheader">Enumeration Type Documentation</h2>
<a id="ga560aa7873d3131c4eb5d1453711305d2" name="ga560aa7873d3131c4eb5d1453711305d2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga560aa7873d3131c4eb5d1453711305d2">&#9670;&nbsp;</a></span>cyhal_syspm_callback_state_t</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="group__group__hal__syspm.html#ga560aa7873d3131c4eb5d1453711305d2">cyhal_syspm_callback_state_t</a></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Flags enum for the cpu state in a custom callback. </p>
<p >This is used to indicate what states a callback should be called in. When a callback is called, only one of these will be set at a time. </p>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="gga560aa7873d3131c4eb5d1453711305d2a30f5d217aded3c5525b1d9cea03ac5a8" name="gga560aa7873d3131c4eb5d1453711305d2a30f5d217aded3c5525b1d9cea03ac5a8"></a>CYHAL_SYSPM_CB_CPU_SLEEP&#160;</td><td class="fielddoc"><p >Flag for MCU sleep callback. </p>
</td></tr>
<tr><td class="fieldname"><a id="gga560aa7873d3131c4eb5d1453711305d2aeaae71eba11b9c861e4a86a6f5c0f2aa" name="gga560aa7873d3131c4eb5d1453711305d2aeaae71eba11b9c861e4a86a6f5c0f2aa"></a>CYHAL_SYSPM_CB_CPU_DEEPSLEEP&#160;</td><td class="fielddoc"><p >Flag for MCU deep sleep callback. </p>
</td></tr>
<tr><td class="fieldname"><a id="gga560aa7873d3131c4eb5d1453711305d2af1a90dd70e5455e36edb783c060a4a98" name="gga560aa7873d3131c4eb5d1453711305d2af1a90dd70e5455e36edb783c060a4a98"></a>CYHAL_SYSPM_CB_CPU_DEEPSLEEP_RAM&#160;</td><td class="fielddoc"><p >Flag for MCU deep sleep ram callback. </p>
</td></tr>
<tr><td class="fieldname"><a id="gga560aa7873d3131c4eb5d1453711305d2ac9de4348b02a53d947ce48bd7bc6922a" name="gga560aa7873d3131c4eb5d1453711305d2ac9de4348b02a53d947ce48bd7bc6922a"></a>CYHAL_SYSPM_CB_SYSTEM_HIBERNATE&#160;</td><td class="fielddoc"><p >Flag for Hibernate callback. </p>
</td></tr>
<tr><td class="fieldname"><a id="gga560aa7873d3131c4eb5d1453711305d2aca71bfa3460ce92a9eed50dace3b8b5a" name="gga560aa7873d3131c4eb5d1453711305d2aca71bfa3460ce92a9eed50dace3b8b5a"></a>CYHAL_SYSPM_CB_SYSTEM_NORMAL&#160;</td><td class="fielddoc"><p >Flag for Normal mode callback. </p>
</td></tr>
<tr><td class="fieldname"><a id="gga560aa7873d3131c4eb5d1453711305d2af13d1c94115a90b1f9d734ace0017045" name="gga560aa7873d3131c4eb5d1453711305d2af13d1c94115a90b1f9d734ace0017045"></a>CYHAL_SYSPM_CB_SYSTEM_LOW&#160;</td><td class="fielddoc"><p >Flag for Low power mode callback. </p>
</td></tr>
</table>

</div>
</div>
<a id="ga5a6a88eb2b6e35dbea25e36b027bf4ba" name="ga5a6a88eb2b6e35dbea25e36b027bf4ba"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga5a6a88eb2b6e35dbea25e36b027bf4ba">&#9670;&nbsp;</a></span>cyhal_syspm_callback_mode_t</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="group__group__hal__syspm.html#ga5a6a88eb2b6e35dbea25e36b027bf4ba">cyhal_syspm_callback_mode_t</a></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Enumeration of the transition modes in custom callback. </p>
<p >The general sequence is: CHECK_READY, BEFORE_TRANSITION, AFTER_TRANSITION. If any callback indicates that it is not able to change state as part of CHECK_READY, CHECK_FAIL will be run instead of the BEFORE/AFTER_TRANSITION. </p>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="gga5a6a88eb2b6e35dbea25e36b027bf4baa1d8aad9b05d313a22e7666a98414f26d" name="gga5a6a88eb2b6e35dbea25e36b027bf4baa1d8aad9b05d313a22e7666a98414f26d"></a>CYHAL_SYSPM_CHECK_READY&#160;</td><td class="fielddoc"><p >Callbacks with this mode are executed before entering into the low power mode. </p>
<p >The purpose of this transition state is to check if the device is ready to enter the low power mode. The application must not perform any actions that would prevent transition after returning true for this mode. </p>
</td></tr>
<tr><td class="fieldname"><a id="gga5a6a88eb2b6e35dbea25e36b027bf4baa190eae9b4e71d4c245038320880dcca3" name="gga5a6a88eb2b6e35dbea25e36b027bf4baa190eae9b4e71d4c245038320880dcca3"></a>CYHAL_SYSPM_CHECK_FAIL&#160;</td><td class="fielddoc"><p >Callbacks with this mode are only executed if the callback returned true for CYHAL_SYSPM_CHECK_READY and a later callback returns false for CYHAL_SYSPM_CHECK_READY. </p>
<p >This mode should roll back any changes made to avoid blocking transition made in CYHAL_SYSPM_CHECK_READY mode </p>
</td></tr>
<tr><td class="fieldname"><a id="gga5a6a88eb2b6e35dbea25e36b027bf4baadd83c77cb81d9d4aafef1d094e6c4e71" name="gga5a6a88eb2b6e35dbea25e36b027bf4baadd83c77cb81d9d4aafef1d094e6c4e71"></a>CYHAL_SYSPM_BEFORE_TRANSITION&#160;</td><td class="fielddoc"><p >Callbacks with this mode are executed after the CYHAL_SYSPM_CHECK_READY callbacks' execution returns true. </p>
<p >In this mode, the application must perform the actions to be done before entering into the low power mode. </p>
</td></tr>
<tr><td class="fieldname"><a id="gga5a6a88eb2b6e35dbea25e36b027bf4baaf6a195dbd042da0bffc35b9161ca49e6" name="gga5a6a88eb2b6e35dbea25e36b027bf4baaf6a195dbd042da0bffc35b9161ca49e6"></a>CYHAL_SYSPM_AFTER_TRANSITION&#160;</td><td class="fielddoc"><p >In this mode, the application must perform the actions to be done after exiting the low power mode. </p>
</td></tr>
<tr><td class="fieldname"><a id="gga5a6a88eb2b6e35dbea25e36b027bf4baa229203f249d95cf1cac7414c1baf66f3" name="gga5a6a88eb2b6e35dbea25e36b027bf4baa229203f249d95cf1cac7414c1baf66f3"></a>CYHAL_SYSPM_AFTER_DS_WFI_TRANSITION&#160;</td><td class="fielddoc"><p >Performs the actions to be done after exiting the Deepsleep low power mode if entered and before the interrupts are enabled.This mode is not invoked on all devices, see the implementation specific documentation for details. </p>
</td></tr>
</table>

</div>
</div>
<a id="ga144e474d3bfb544b207f172d1d8bd633" name="ga144e474d3bfb544b207f172d1d8bd633"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga144e474d3bfb544b207f172d1d8bd633">&#9670;&nbsp;</a></span>cyhal_syspm_system_state_t</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="group__group__hal__syspm.html#ga144e474d3bfb544b207f172d1d8bd633">cyhal_syspm_system_state_t</a></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Enumeration of the system wide power modes. </p>
<p >These modes are device specifc and may not be supported on all devices. Refer to the device specific documentation or the Data Sheet to determine what is allowed. Devices that do support these modes may have requirements for adjusting system settings such as clocks or voltage levels before transition. </p>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="gga144e474d3bfb544b207f172d1d8bd633acd2a5522b6591eb77418369e464a3eb1" name="gga144e474d3bfb544b207f172d1d8bd633acd2a5522b6591eb77418369e464a3eb1"></a>CYHAL_SYSPM_SYSTEM_NORMAL&#160;</td><td class="fielddoc"><p >Normal Mode. </p>
</td></tr>
<tr><td class="fieldname"><a id="gga144e474d3bfb544b207f172d1d8bd633af4060b98561e43a6b930576644af014f" name="gga144e474d3bfb544b207f172d1d8bd633af4060b98561e43a6b930576644af014f"></a>CYHAL_SYSPM_SYSTEM_LOW&#160;</td><td class="fielddoc"><p >Low Power Mode. </p>
</td></tr>
</table>

</div>
</div>
<a id="ga624438ff56f764659e2afa62b7eafba0" name="ga624438ff56f764659e2afa62b7eafba0"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga624438ff56f764659e2afa62b7eafba0">&#9670;&nbsp;</a></span>cyhal_syspm_system_deep_sleep_mode_t</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="group__group__hal__syspm.html#ga624438ff56f764659e2afa62b7eafba0">cyhal_syspm_system_deep_sleep_mode_t</a></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Enumeration of the system Deep Sleep modes. </p>
<p >These modes are device specifc and may not be supported on all devices. Refer to the device specific documentation or the Data Sheet to determine what is allowed. </p>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="gga624438ff56f764659e2afa62b7eafba0afffaf708d36fcd3a37cc23a009090a7d" name="gga624438ff56f764659e2afa62b7eafba0afffaf708d36fcd3a37cc23a009090a7d"></a>CYHAL_SYSPM_SYSTEM_DEEPSLEEP_NONE&#160;</td><td class="fielddoc"><p >Not Deep Sleep Mode. </p>
</td></tr>
<tr><td class="fieldname"><a id="gga624438ff56f764659e2afa62b7eafba0a052a17cb28779a2cdf08776f6ccb20a1" name="gga624438ff56f764659e2afa62b7eafba0a052a17cb28779a2cdf08776f6ccb20a1"></a>CYHAL_SYSPM_SYSTEM_DEEPSLEEP&#160;</td><td class="fielddoc"><p >Deep Sleep Mode. </p>
<p ><br  />
 </p>
</td></tr>
<tr><td class="fieldname"><a id="gga624438ff56f764659e2afa62b7eafba0a7e34e297ecd6710c7b6eb1237fdc5abe" name="gga624438ff56f764659e2afa62b7eafba0a7e34e297ecd6710c7b6eb1237fdc5abe"></a>CYHAL_SYSPM_SYSTEM_DEEPSLEEP_RAM&#160;</td><td class="fielddoc"><p >Deep Sleep RAM Mode. </p>
</td></tr>
<tr><td class="fieldname"><a id="gga624438ff56f764659e2afa62b7eafba0a0a6ced1a860c896bd94508f8af2e99f0" name="gga624438ff56f764659e2afa62b7eafba0a0a6ced1a860c896bd94508f8af2e99f0"></a>CYHAL_SYSPM_SYSTEM_DEEPSLEEP_OFF&#160;</td><td class="fielddoc"><p >Deep Sleep OFF Mode. </p>
</td></tr>
</table>

</div>
</div>
<a id="ga716955af458772e538910575cbf6e1dd" name="ga716955af458772e538910575cbf6e1dd"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga716955af458772e538910575cbf6e1dd">&#9670;&nbsp;</a></span>cyhal_syspm_hibernate_source_t</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="group__group__hal__syspm.html#ga716955af458772e538910575cbf6e1dd">cyhal_syspm_hibernate_source_t</a></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Flags enum for the hibernate wakeup sources. </p>
<dl class="section note"><dt>Note</dt><dd>Not all wakeup sources are valid on devices. Refer to the datasheet for device specifics. </dd></dl>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="gga716955af458772e538910575cbf6e1dda57c81752ef79a93b9a9701c59a8b35e3" name="gga716955af458772e538910575cbf6e1dda57c81752ef79a93b9a9701c59a8b35e3"></a>CYHAL_SYSPM_HIBERNATE_LPCOMP0_LOW&#160;</td><td class="fielddoc"><p >Wake on a low logic level for the LPComp0. </p>
</td></tr>
<tr><td class="fieldname"><a id="gga716955af458772e538910575cbf6e1dda765ef14d1cc8c55710c122b77798204b" name="gga716955af458772e538910575cbf6e1dda765ef14d1cc8c55710c122b77798204b"></a>CYHAL_SYSPM_HIBERNATE_LPCOMP0_HIGH&#160;</td><td class="fielddoc"><p >Wake on a high logic level for the LPComp0. </p>
</td></tr>
<tr><td class="fieldname"><a id="gga716955af458772e538910575cbf6e1dda0a4d1ab39bb8cbece570a555971bcd99" name="gga716955af458772e538910575cbf6e1dda0a4d1ab39bb8cbece570a555971bcd99"></a>CYHAL_SYSPM_HIBERNATE_LPCOMP1_LOW&#160;</td><td class="fielddoc"><p >Wake on a low logic level for the LPComp1. </p>
</td></tr>
<tr><td class="fieldname"><a id="gga716955af458772e538910575cbf6e1dda46ab6d77f810acb319caff3616a8f88c" name="gga716955af458772e538910575cbf6e1dda46ab6d77f810acb319caff3616a8f88c"></a>CYHAL_SYSPM_HIBERNATE_LPCOMP1_HIGH&#160;</td><td class="fielddoc"><p >Wake on a high logic level for the LPComp1. </p>
</td></tr>
<tr><td class="fieldname"><a id="gga716955af458772e538910575cbf6e1dda2a495fcdf84252843b6fc9bc4e27206a" name="gga716955af458772e538910575cbf6e1dda2a495fcdf84252843b6fc9bc4e27206a"></a>CYHAL_SYSPM_HIBERNATE_RTC_ALARM&#160;</td><td class="fielddoc"><p >Configure the RTC alarm as wakeup source. </p>
</td></tr>
<tr><td class="fieldname"><a id="gga716955af458772e538910575cbf6e1dda519c726a562e214bd1694137e62a22e1" name="gga716955af458772e538910575cbf6e1dda519c726a562e214bd1694137e62a22e1"></a>CYHAL_SYSPM_HIBERNATE_WDT&#160;</td><td class="fielddoc"><p >Configure the WDT interrupt as wakeup source. </p>
</td></tr>
<tr><td class="fieldname"><a id="gga716955af458772e538910575cbf6e1dda9ccdbb4f654ce023bea0fafba50cab53" name="gga716955af458772e538910575cbf6e1dda9ccdbb4f654ce023bea0fafba50cab53"></a>CYHAL_SYSPM_HIBERNATE_PINA_LOW&#160;</td><td class="fielddoc"><p >Configure a low logic level for the first wakeup-pin. </p>
<p >See device datasheet for specific pin. </p>
</td></tr>
<tr><td class="fieldname"><a id="gga716955af458772e538910575cbf6e1dda0882eed07391eb7773ea2f4c47a7b5ff" name="gga716955af458772e538910575cbf6e1dda0882eed07391eb7773ea2f4c47a7b5ff"></a>CYHAL_SYSPM_HIBERNATE_PINA_HIGH&#160;</td><td class="fielddoc"><p >Configure a high logic level for the first wakeup-pin. </p>
<p >See device datasheet for specific pin. </p>
</td></tr>
<tr><td class="fieldname"><a id="gga716955af458772e538910575cbf6e1dda1bf3cfcfb69b48e6b0ef5a525cc6eb3d" name="gga716955af458772e538910575cbf6e1dda1bf3cfcfb69b48e6b0ef5a525cc6eb3d"></a>CYHAL_SYSPM_HIBERNATE_PINB_LOW&#160;</td><td class="fielddoc"><p >Configure a low logic level for the second wakeup-pin. </p>
<p >See device datasheet for specific pin. </p>
</td></tr>
<tr><td class="fieldname"><a id="gga716955af458772e538910575cbf6e1dda69f639b3f33245d1a789fd443b94b47d" name="gga716955af458772e538910575cbf6e1dda69f639b3f33245d1a789fd443b94b47d"></a>CYHAL_SYSPM_HIBERNATE_PINB_HIGH&#160;</td><td class="fielddoc"><p >Configure a high logic level for the second wakeup-pin. </p>
<p >See device datasheet for specific pin. </p>
</td></tr>
</table>

</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a id="ga299e36096b0ad36b29afe3c5bb02a6d7" name="ga299e36096b0ad36b29afe3c5bb02a6d7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga299e36096b0ad36b29afe3c5bb02a6d7">&#9670;&nbsp;</a></span>cyhal_syspm_init()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a> cyhal_syspm_init </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Performs any system wide power management initialization that is needed for future operations. </p>
<p >This can include things like unlocking IOs that might have been frozen when entering a low power state or registering callback functions that are necessary to allow notifications of power events. This should be called as part of initializing the device in a Board Support Package (BSP).</p>
<dl class="section return"><dt>Returns</dt><dd>Returns CY_RSLT_SUCCESS if the processor successfully entered the hibernate mode, otherwise error. </dd></dl>

</div>
</div>
<a id="ga507445e44ab6aae0f4cbaabaec6c5a3f" name="ga507445e44ab6aae0f4cbaabaec6c5a3f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga507445e44ab6aae0f4cbaabaec6c5a3f">&#9670;&nbsp;</a></span>cyhal_syspm_hibernate()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a> cyhal_syspm_hibernate </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__syspm.html#ga716955af458772e538910575cbf6e1dd">cyhal_syspm_hibernate_source_t</a>&#160;</td>
          <td class="paramname"><em>wakeup_source</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Sets the system mode to hibernate. </p>
<p >This function configures the sources to wake up the device from hibernate mode and then sets the system to hibernate mode.</p>
<p >In hibernate mode, all internal supplies are off and no internal state is retained.</p>
<p >Sources can be wakeup pins, LPComparators, Watchdog (WDT) interrupt, or a Real-Time clock (RTC) alarm (interrupt). Wakeup from system hibernate always results in a device reset and normal boot process.</p>
<p >Wakeup pins:</p>
<p >A wakeup is supported by pins with programmable polarity. These pins are typically connected to the GPIO pins or on-chip peripherals under some conditions. See device datasheet to check if this feature is supported and for specific pin connections. Setting the wakeup pin to this level will cause a wakeup from system hibernate mode.</p>
<p >LPComparators:</p>
<p >A wakeup is supported by LPComps with programmable polarity. Setting the LPComp to this level will cause a wakeup from system hibernate mode.</p>
<p >Watchdog Timer:</p>
<p >A wakeup is performed by a WDT interrupt.</p>
<p >Real-time Clock:</p>
<p >A wakeup is performed by the RTC alarm.</p>
<p >For information about hibernate behavior, wakeup sources and their assignment in specific devices, refer to the appropriate device TRM.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">wakeup_source</td><td>The source to be configured as a wakeup source from the system hibernate power mode, see <a class="el" href="group__group__hal__syspm.html#ga716955af458772e538910575cbf6e1dd">cyhal_syspm_hibernate_source_t</a>. The input parameter values can be ORed. For example, if you want to enable LPComp0 (active high) and WDT, call this function: cyhal_syspm_hibernate(CYHAL_SYSPM_HIBERNATE_LPCOMP0_HIGH | CYHAL_SYSPM_HIBERNATE_WDT).</td></tr>
  </table>
  </dd>
</dl>
<dl class="section warning"><dt>Warning</dt><dd>Do not call this function with different polarity levels for the same wakeup source. For example, do not call a function like this: cyhal_syspm_hibernate(CYHAL_SYSPM_HIBERNATE_LPCOMP0_LOW | CYHAL_SYSPM_HIBERNATE_LPCOMP0_HIGH);</dd></dl>
<dl class="section return"><dt>Returns</dt><dd>Returns CY_RSLT_SUCCESS if the processor successfully entered the hibernate mode, otherwise error. </dd></dl>

</div>
</div>
<a id="gaae0157682bad1b2155738e73347afa87" name="gaae0157682bad1b2155738e73347afa87"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaae0157682bad1b2155738e73347afa87">&#9670;&nbsp;</a></span>cyhal_syspm_set_system_state()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a> cyhal_syspm_set_system_state </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__syspm.html#ga144e474d3bfb544b207f172d1d8bd633">cyhal_syspm_system_state_t</a>&#160;</td>
          <td class="paramname"><em>state</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Set the system-wide state of the device. </p>
<p >This is used to change the power state within the Active power mode. <a class="el" href="group__group__hal__syspm.html#gaaf3fe209bb106f490f207394bb35043a">cyhal_syspm_get_system_state</a> can be used to get the current state. </p><dl class="section note"><dt>Note</dt><dd>Not all devices support different states within the Active power mode. If the device does not support changing state, an error will be returned.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">state</td><td>System wide state.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Returns CY_RSLT_SUCCESS if the processor successfully entered the requested system state, otherwise error. </dd></dl>

</div>
</div>
<a id="gaaf3fe209bb106f490f207394bb35043a" name="gaaf3fe209bb106f490f207394bb35043a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaaf3fe209bb106f490f207394bb35043a">&#9670;&nbsp;</a></span>cyhal_syspm_get_system_state()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__hal__syspm.html#ga144e474d3bfb544b207f172d1d8bd633">cyhal_syspm_system_state_t</a> cyhal_syspm_get_system_state </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Gets the system-wide state of the device. </p>
<p >States can be changed by calling <a class="el" href="group__group__hal__syspm.html#gaae0157682bad1b2155738e73347afa87">cyhal_syspm_set_system_state</a>. </p><dl class="section note"><dt>Note</dt><dd>Not all devices support different states within the Active power mode. If the device does not support changing state, this will return <a class="el" href="group__group__hal__syspm.html#gga144e474d3bfb544b207f172d1d8bd633acd2a5522b6591eb77418369e464a3eb1">CYHAL_SYSPM_SYSTEM_NORMAL</a>. </dd></dl>
<dl class="section return"><dt>Returns</dt><dd>Returns the current system-wide power state of the device. </dd></dl>

</div>
</div>
<a id="ga5d1637ece9b27528636981acfc893fd3" name="ga5d1637ece9b27528636981acfc893fd3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga5d1637ece9b27528636981acfc893fd3">&#9670;&nbsp;</a></span>cyhal_syspm_register_callback()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void cyhal_syspm_register_callback </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__syspm.html#structcyhal__syspm__callback__data__t">cyhal_syspm_callback_data_t</a> *&#160;</td>
          <td class="paramname"><em>callback_data</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Register the specified handler with the power manager to be notified of power state changes. </p>
<p >This is intended for application wide decisions. Peripherals handle their ability to perform power transitions internally. This callback will be called before any of the peripheral callbacks for <a class="el" href="group__group__hal__syspm.html#gga5a6a88eb2b6e35dbea25e36b027bf4baa1d8aad9b05d313a22e7666a98414f26d">CYHAL_SYSPM_CHECK_READY</a> and <a class="el" href="group__group__hal__syspm.html#gga5a6a88eb2b6e35dbea25e36b027bf4baadd83c77cb81d9d4aafef1d094e6c4e71">CYHAL_SYSPM_BEFORE_TRANSITION</a>. This callback will be called after all peripheral callback for <a class="el" href="group__group__hal__syspm.html#gga5a6a88eb2b6e35dbea25e36b027bf4baa190eae9b4e71d4c245038320880dcca3">CYHAL_SYSPM_CHECK_FAIL</a> and <a class="el" href="group__group__hal__syspm.html#gga5a6a88eb2b6e35dbea25e36b027bf4baaf6a195dbd042da0bffc35b9161ca49e6">CYHAL_SYSPM_AFTER_TRANSITION</a>. </p><dl class="section note"><dt>Note</dt><dd>The callback will be executed from a critical section</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">callback_data</td><td>The data for the callback to register </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="gae069670790199a668edffa9ec01fd538" name="gae069670790199a668edffa9ec01fd538"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gae069670790199a668edffa9ec01fd538">&#9670;&nbsp;</a></span>cyhal_syspm_unregister_callback()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void cyhal_syspm_unregister_callback </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__syspm.html#structcyhal__syspm__callback__data__t">cyhal_syspm_callback_data_t</a> *&#160;</td>
          <td class="paramname"><em>callback_data</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Removes the registered handler from the power manager so no future notifications are made. </p>
<ul>
<li><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">callback_data</td><td>The data for the callback to unregister </td></tr>
  </table>
  </dd>
</dl>
</li>
</ul>

</div>
</div>
<a id="gac3e07ce98d215865b0f7f0149073bae2" name="gac3e07ce98d215865b0f7f0149073bae2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gac3e07ce98d215865b0f7f0149073bae2">&#9670;&nbsp;</a></span>cyhal_syspm_sleep()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a> cyhal_syspm_sleep </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Set CPU to sleep mode. </p>
<dl class="section return"><dt>Returns</dt><dd>Returns CY_RSLT_SUCCESS if the processor successfully entered the sleep mode , otherwise error. </dd></dl>

</div>
</div>
<a id="ga0afe7e58c0df4a2eda5010ac628ea981" name="ga0afe7e58c0df4a2eda5010ac628ea981"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga0afe7e58c0df4a2eda5010ac628ea981">&#9670;&nbsp;</a></span>cyhal_syspm_deepsleep()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a> cyhal_syspm_deepsleep </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Set CPU to deep sleep mode. </p>
<dl class="section return"><dt>Returns</dt><dd>Returns CY_RSLT_SUCCESS if the processor successfully entered the deep sleep mode, otherwise error. </dd></dl>

</div>
</div>
<a id="ga3568214a6038240239f99768fe6707d6" name="ga3568214a6038240239f99768fe6707d6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga3568214a6038240239f99768fe6707d6">&#9670;&nbsp;</a></span>cyhal_syspm_lock_deepsleep()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void cyhal_syspm_lock_deepsleep </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Lock deep sleep. </p>
<p >This function prevents the CPU from going to deep sleep. The lock is implemented as a counter from 0 to USHRT_MAX. Each call to this function increments the counter by 1. <a class="el" href="group__group__hal__syspm.html#ga028b85f03d4607ccac8494b46ec8413c">cyhal_syspm_unlock_deepsleep</a> must be called an equal number of times to fully unlock. Deepsleep will only be allowed when the counter is equal to 0. </p>

</div>
</div>
<a id="ga028b85f03d4607ccac8494b46ec8413c" name="ga028b85f03d4607ccac8494b46ec8413c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga028b85f03d4607ccac8494b46ec8413c">&#9670;&nbsp;</a></span>cyhal_syspm_unlock_deepsleep()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void cyhal_syspm_unlock_deepsleep </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Unlock deep sleep. </p>
<p >This function decrements the lock counter by 1 and must be called an equal number of times as <a class="el" href="group__group__hal__syspm.html#ga3568214a6038240239f99768fe6707d6">cyhal_syspm_lock_deepsleep</a> is called to fully unlock. Deepsleep will only be allowed when the counter is equal to 0. </p>

</div>
</div>
<a id="ga2bbc7d6e2727228629d7e485ed9a6565" name="ga2bbc7d6e2727228629d7e485ed9a6565"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga2bbc7d6e2727228629d7e485ed9a6565">&#9670;&nbsp;</a></span>cyhal_syspm_tickless_deepsleep()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a> cyhal_syspm_tickless_deepsleep </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__lptimer__t">cyhal_lptimer_t</a> *&#160;</td>
          <td class="paramname"><em>lptimer_obj</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>desired_ms</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t *&#160;</td>
          <td class="paramname"><em>actual_ms</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Timed deep-sleep without system timer. </p>
<p >Provides a way to deep-sleep for a desired number of milliseconds(ms) with the system timer disabled. The system timer is disabled before sleeping and a low power timer is setup to wake the device from deep-sleep after the desired number of ms have elapsed.</p>
<dl class="section note"><dt>Note</dt><dd>The actual ms in the best case will be 1 ms less than the desired time to prevent the device from over-sleeping due to low clock accuracy.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">lptimer_obj</td><td>Pre-Initialized LPTimer object. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">desired_ms</td><td>Desired number of ms to deep-sleep. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">actual_ms</td><td>Actual number of ms that was spent in deep-sleep. This value can range from 0 to desired_ms - 1 depending on how long the device was able to deep-sleep. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The status of the deep-sleep request. </dd></dl>

</div>
</div>
<a id="gadc3bb2e5eff7491f79585034bbe99cb0" name="gadc3bb2e5eff7491f79585034bbe99cb0"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gadc3bb2e5eff7491f79585034bbe99cb0">&#9670;&nbsp;</a></span>cyhal_syspm_tickless_sleep()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a> cyhal_syspm_tickless_sleep </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__lptimer__t">cyhal_lptimer_t</a> *&#160;</td>
          <td class="paramname"><em>lptimer_obj</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>desired_ms</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t *&#160;</td>
          <td class="paramname"><em>actual_ms</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Timed sleep without system timer. </p>
<p >Provides a way to sleep for a desired number of milliseconds(ms) with the system timer disabled. The system timer is disabled before sleeping and a low power timer is setup to wake the device from sleep after the desired number of ms have elapsed.</p>
<dl class="section note"><dt>Note</dt><dd>The actual ms in the best case will be 1 ms less than the desired time to prevent the device from over-sleeping due to low clock accuracy.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">lptimer_obj</td><td>Pre-Initialized LPTimer object. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">desired_ms</td><td>Desired number of ms to sleep. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">actual_ms</td><td>Actual number of ms that was spent in sleep. This value can range from 0 to desired_ms - 1 depending on how long the device was able to sleep. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The status of the sleep request. </dd></dl>

</div>
</div>
<a id="ga60a496432477ed130a5549550009bc61" name="ga60a496432477ed130a5549550009bc61"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga60a496432477ed130a5549550009bc61">&#9670;&nbsp;</a></span>cyhal_syspm_get_deepsleep_mode()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__hal__syspm.html#ga624438ff56f764659e2afa62b7eafba0">cyhal_syspm_system_deep_sleep_mode_t</a> cyhal_syspm_get_deepsleep_mode </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Get current deep sleep mode. </p>
<p >Provides a way to get the current deep sleep mode. </p><dl class="section return"><dt>Returns</dt><dd>The current deep sleep mode. </dd></dl>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part
<div id="nav-path" class="navpath">
    <ul>
        <li class="footer">
            Generated for <b>Hardware Abstraction Layer (HAL)</b> by <b>Cypress Semiconductor Corporation</b>.
            All rights reserved.
        </li>
    </ul>
</div>
-->
</body>
</html>
